package test0928.deepclone;

public class Dome {
    public static void main(String[] args) throws CloneNotSupportedException {
        Car car = new Car("red","123456");
        //Car car1 = new Car(car);
        //Car car2 = (Car) car.clone();
        //car.setColor("black");
        //System.out.println(car);
        //System.out.println(car2);

        Driver driver = new Driver(20,"张三",car);
        Driver driver1 = (Driver) driver.clone();
        System.out.println(driver);
        System.out.println(driver1);
//        driver.setAge(25);
        driver1.getCar().setColor("green");
        System.out.println(driver);
        System.out.println(driver1);


    }
}
